<?php
/**
 * Dependency plugin service interface
 *
 * PHP version 5
 *
 * @category  W
 * @package   Interfaces
 * @author    Olivier Hoareau <olivier@phppro.fr>
 * @copyright 2009 PHPPRO http://www.phppro.fr
 * @license   http://dev.phppro.fr/license PHPPRO
 * @version   SVN: $Id:$
 * @link      http://dev.phppro.fr/projects/wdependency
 */
/**
 * Dependency plugin service interface
 *
 * @category  W
 * @package   Services
 * @author    Olivier Hoareau <olivier@phppro.fr>
 * @copyright 2009 PHPPRO http://www.phppro.fr
 * @license   http://dev.phppro.fr/license PHPPRO
 * @version   SVN: $Id$
 * @link      http://dev.phppro.fr/projects/wdependency
 */
interface W_Dependency_Plugin_Interface
{
    /**
     * Returns the plugin default package configuration option
     *
     * @return string
     */
    public function getPluginDefaultPackage ();
    /**
     * Sets the plugin default package configuration option
     *
     * @param string $pluginDefaultPackage default package
     *
     * @return W_Dependency_Plugin_Interface
     */
    public function setPluginDefaultPackage ($pluginDefaultPackage);
    /**
     * Adds the specified plugin by type
     *
     * @param string|object $plugin the plugin
     * @param string        $type   the plugin type
     *
     * @return W_Dependency_Plugin_Interface
     *
     * @throws Exception if an error occured
     */
    public function addPlugin ($plugin, $options, $type,$defaultPackage=null);
    /**
     * Fires the specified event to the registered listeners
     *
     * @param string      $eventType the event type
     * @param array|mixed $eventData the event data
     *
     * @return array|null list of optional additional item to process
     *
     * @throws Exception if an error occured
     */
    public function fireEvent ($eventType, $eventData = null);
    /**
     * Returns the computed data
     *
     * @param  string $type the plugin type
     *
     * @return array the collected data
     *
     * @throws Exception if an error occured
     */
    public function getCollectedPluginsData ($type);
    /**
     * Executes all registered plugins of specified type
     * and returns computed data
     *
     * @param string $type plugin type
     * @param mixed  $data execution parameter(s)
     *
     * @return mixed execution result
     *
     * @throws Exception if an error occured
     */
    public function executePlugins ($type, $data);
}